<!doctype html>
<html>
{include file="head.html"}

<body>
<div class="header" >
    <a  class="left-btn pointer" href="{$appkoudai}?m=kcorder"><span class="iconfont icon-back"></span></a>
    <div class="title">订单管理</div>
     
  </div>
  <div class="main-body">
 
<table class="kdtable" width="100%">
    {foreach item=p from=$order_product}
    <tr>
      <td style="width:60px;"><img src="{$p.imgurl|images_site}.100x100.jpg" width="50" /></td>
      <td class="km"><div class="hd">{$p.title}</div>
       
         <div>下单价：{$p.price} 
        共<span class="buy_num">{$p.buy_num}</span>件 {if $data.status eq 0}<a href="javascript:;" class="chnum" url="{$appkoudai}?m=kcorder&a=pronum&ajax=1&order_id={$data.order_id}&productid={$p.productid}&num=-1"  style="color:red">减数量</a>
        
        <a href="javascript:;" class="chnum" url="{$appkoudai}?m=kcorder&a=pronum&ajax=1&order_id={$data.order_id}&productid={$p.productid}&num=1"  style="color:red">加数量</a>
        {/if}
        </div>
        </td>
    </tr>
    {/foreach}
  </table>


 <div class="h10"></div>
 
  
  <div class="kdtotalbox">
  		<div class="l">共<span id="total_num">{$data.total_num}</span>件</div>
        <div class="r">合计：￥<span id="money">{$data.money}</span>件</div>
  </div>
  <div class="kdcomment">备注：<span>{$data.comment}</span></div>
  <table class="table-addr">
  	<tr>
    	<td class="t1">姓名 </td>
        <td>{$data.nickname}</td>
    </tr>
    
    <tr>
    	<td class="t1">电话 </td>
        <td><a href="tel:{$data.telephone}">{$data.telephone}</a></td>
    </tr>
    
    <tr>
    	<td class="t1">地址 </td>
        <td>{$site.sitename}-{$data.address}</td>
    </tr>
    
  </table>
  
  <table class="table-addr">
  	
    <tr>
    	<td class="t2">订单编号 </td>
        <td>{$data.orderno}</td>
    </tr>
     
    <tr>
    	<td class="t2">下单时间 </td>
        <td>{$data.dateline|date:Y-m-d H:i:s}</td>
    </tr>
    
     <tr>
	<td class="t2">状态</td><td> {$order_status_list[$data.status]}   {if $data.isreceived eq 2}已收货{else}未收货 &nbsp;
    {if $data.status eq 0}<a href="{$appkoudai}?m=kcorder&a=cancel&order_id={$data.order_id}">取消订单</a>{/if}
    {if $data.status eq 2}<a href="{$appkoudai}?m=kcorder&a=receive&order_id={$data.order_id}" style="color:red">确认收货</a>{/if}{/if}</td>
	 
</tr>
    
  </table>
  <div class="clearfix"></div> 
</div>

</div>
<script>
$(function(){
	$(".chnum").on("click",function(){
		var obj=$(this);
		$.get(obj.attr("url"),function(data){
			if(data.error){
				skyToast(data.message);
			}else{
				
				obj.parents("tr").find(".buy_num").html(data.data.buy_num); 
				$("#money").html(data.data.money);
				$("#total_num").html(data.data.total_num);

			}
		},"json");
	});
});
</script>
{include file="footer.html"}